package com.sunday.electric.http;

import com.sunday.common.model.ResultDO;
import com.sunday.electric.entity.Member;
import com.sunday.electric.entity.Token;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;

/**
 * Created by Administrator on 2016/1/26.
 */
public interface IMService {
    @FormUrlEncoded
    @POST("/user/getToken.json")
    Call<Token> getToken(@Field("userId") String userId, @Field("name") String name, @Field("portraitUri") String portraitUri);


    /**
     * 登录
     * @param username
     * @return
     */
    @FormUrlEncoded
    @POST("/RedWS/jc/Login.go?method=Login")
    Call<ResultDO<Member>> login(@Field("username") String username,
                                 @Field("password") String password,
                                 @Field("isWBPerson") int isWBPerson);

/*    @Multipart
    @PUT("user/photo")
    Call<Object> updateImage(@Part("photo") RequestBody photo, @Part("description") RequestBody description);*/

    /**
     * 签到功能
     * @param latitude
     * @param longitude
     * @return
     */
    @FormUrlEncoded
    @POST("/HD_JC/app/appPlan.go")
    Call<ResultDO> siginUser(@Field("latitude") String latitude, @Field("longitude") String longitude,
                             @Field("method") String method,
                             @Field("jcPlanExcuteId") String jcPlanExcuteId,@Field("address") String address);


}
